/*-
 * Copyright (c) 2007 Microsoft
 * All rights reserved.
 */

#include "StdAfx.h"
#include "MPIException.h"
#include "AsyncResult.h"
#include "AsyncHelper.h"


using namespace System;
using namespace System::Threading;
using namespace System::Collections;
using namespace Microsoft::ComputeCluster::MpiNet;

///<summary>
///Initialize helper.
///</summary>
void AsyncHelper::Initialize()
{
    Exit = false;
    runningOperations = Queue::Synchronized(gcnew Queue());
    //pendingEvent = gcnew AutoResetEvent(false);
    Thread^ helperThread = gcnew Thread(gcnew ThreadStart(PollThread));
    helperThread->Start();
}

void AsyncHelper::RegisterOperation(AsyncResult^ op)
{
}

void AsyncHelper::PollThread()
{
    while(!Exit)
    {
        
    }
}